home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_12_03
/
allison
/
trace.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-05
|
392b
|
28 lines
Listing 3 - Illustrates the Stringizing Operator
/* trace.c: Illustrate a trace macro for debugging */
#include <stdio.h>
#define trace(x,format) \
printf(#x " = %" #format "\n",x)
main()
{
int i = 1;
float x = 2.0;
char *s = "three";
trace(i,d);
trace(x,f);
trace(s,s);
return 0;
}
/* Output:
i = 1
x = 2.000000
s = three
*/